package com.huaxin.device.models;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.huaxin.device.dto.enums.ConnectionType;
import com.huaxin.device.dto.enums.EquipmentType;
import com.huaxin.device.dto.enums.PhaseCount;
import com.huaxin.device.dto.enums.VoltageLevel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 设备连接关系表（通用走线表）
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("equipment_connections")
@Schema(description = "设备连接关系")
public class EquipmentConnection extends BaseModel {

    @TableField(value = "from_equipment_type")
    @Schema(description = "起点设备类型", example = "Transformer")
    private EquipmentType fromEquipmentType;

    @TableField(value = "from_equipment_id")
    @Schema(description = "起点设备ID", example = "eq123e456-789a-bcde-f012-3456789abcde")
    private String fromEquipmentId;

    @TableField(value = "to_equipment_type")
    @Schema(description = "终点设备类型", example = "Cabinet")
    private EquipmentType toEquipmentType;

    @TableField(value = "to_equipment_id")
    @Schema(description = "终点设备ID", example = "cb123e456-789a-bcde-f012-3456789abcde")
    private String toEquipmentId;

    @TableField(value = "connection_type")
    @Schema(description = "连接类型：Cable, Busbar, Wire 等", example = "Cable")
    private ConnectionType connectionType;

    @TableField(value = "connection_name")
    @Schema(description = "连接名称", example = "Main Feeder Cable-01")
    private String connectionName;

    @TableField(value = "voltage_level")
    @Schema(description = "电压等级", example = "10KV")
    private VoltageLevel voltageLevel;

    @TableField(value = "wire_size")
    @Schema(description = "线径", example = "3*120mm²")
    private String wireSize;

    @TableField(value = "length")
    @Schema(description = "长度（米）", example = "45.50")
    private BigDecimal length;

    @TableField(value = "phase_count")
    @Schema(description = "相数：1/3", example = "3")
    private PhaseCount phaseCount;

    @TableField(value = "notes")
    @Schema(description = "备注")
    private String notes;
}